package com.software.usercenter.service;

import cn.hutool.json.JSONObject;
import com.software.usercenter.entity.*;
import com.software.usercenter.entity.Record;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;


/**
 * Author: zk
 * Description: 用户User的服务层
 */
public interface UserService {
    User register(User user);

    User login(User user);

    void updateUserById(User user);

    JSONObject publishAnswer(Answer answer);

    JSONObject queryAnswerList(Integer questionId, Integer pageNum, Integer size);

    JSONObject queryAnswer(String answerId);

    Record insertRecord(Record record);

    Page queryRecordList(String userId, Integer questionId, Pageable pageable);

    Page queryRank(Pageable pageable);

    Record queryRecord(Integer recordId);

    void updatePassword(User user);

    User findUserById(String id);

    RankUser queryOwnRank(User user);

    List<Record> queryOwnRecordList(String userId, Integer questionId);
}
